Add a User-Agent when using the Lambda Runtime API#98
Merged
tomerd merged 2 commits intoawslabs:masterfrom May 30, 2020
bmoffatt:master
Merged
Add a User-Agent when using the Lambda Runtime API#98tomerd merged 2 commits intoawslabs:masterfrom bmoffatt:master
tomerd merged 2 commits intoawslabs:masterfrom
bmoffatt:master
Conversation
|
Can one of the admins verify this patch? |
3 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
weissi
reviewed
May 30, 2020
weissi
reviewed
May 30, 2020
Contributor
weissi
left a comment
There was a problem hiding this comment.
Thanks, that looks like a good idea to me. Left a small note :)
fabianfett
approved these changes
May 30, 2020
Contributor
|
@swift-server-bot add to whitelist |
Contributor
|
@swift-server-bot test this pease |
|
I assume you are maintaining some sort of version string for this package somewhere in the code. If so, it might be a good idea to incorporate the version string into the User Agent string. It would make it possible to track usage of the runtime across versions. |
Contributor
Contributor
sebsto
added a commit
that referenced
this pull request
Jul 21, 2025
Add a hard coded version number to the user agent string, for an eventual identification by the Lambda service ### Motivation: It's [an issue](#108) that was open more than 5 years ago and was never addressed. At the time, the consensus was to pickup a version number for the Package.swift file and the maintainer at the time decided to wait for Swift to implement this. Five years later, and several major version of Swift later, this is still not available. I decided to move on and implement a less optimal solution. This can be replaced in the future if package version ever becomes part of Package.swift. ### Modifications: Add a version enum to isolate the versioning in one place. I decided to keep it simple and not over engineering it with major, minor, patch and pre-release. At the time, it's a simple string. This is all what we need for usage in the user agent string. ### Result: User agent now identifies as `Swift-Lambda/2,0` instead of `Swift-Lambda/unknown`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #96 - This will help you stand out in a crowd of "Unknown/Unknown" in our logs